<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>图标管理</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
#@css?("layui")
<style>
.imgview {
	width: 50px;
	height: 50px;
}
</style>
</head>
<body>
	<fieldset class="layui-elem-field layui-field-title">
		<legend>角色管理</legend>
	</fieldset>
	<fieldset class="layui-elem-field site-demo-button">
		<div class="layui-btn-group">
			<a class="layui-btn layui-btn-normal" href="#(ctx)/admin/role/add">增加</a>
			<button class="layui-btn layui-btn-normal" id="delAll">删除所选</button>
		</div>
	</fieldset>
	<table class="layui-table" lay-skin="nob">
		<colgroup>
			<col width="50">
			<col width="150">
			<col width="300">
			<col>
		</colgroup>
		<thead>
			<tr>
				<th>选取</th>
				<th>角色名称</th>
				<th>职能描述</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			#for(t:tableList)
			<tr>
				<td><input type="checkbox" id="all" value="#(t.id)" /></td>
				<td>#(t.name)</td>
				<td>#(t.remark)</td>
				<td><div class="layui-btn-group">
						<a class="layui-btn layui-btn-normal"
							href="#(ctx)/admin/power/manage?rid=#(t.id)">权限</a> <a
							class="layui-btn layui-btn-normal"
							href="#(ctx)/admin/role/edit?id=#(t.id)">编辑</a> <a
							class="layui-btn layui-btn-normal"
							href="#(ctx)/admin/role/delete?id=#(t.id)">删除</a>
					</div></td>
			</tr>
			#end
		</tbody>
	</table>

	#@js?("layui")
	<script>
		layui.use([ "jquery", "layer" ], function() {
			var $ = layui.jquery, layer = layui.layer;
			$("#delAll").bind("click", function() {
				var chk_value = checkboxSelected();
				if (chk_value.length == 0) {
					layer.msg("您未选择任何数据!");
					return;
				}
				window.location.href = "#(ctx)/admin/role/delete?id=" + chk_value;
			});
			var checkboxSelected = function checkboxSelected() { //jquery获取复选框值 
				var chk_value = [];
				$('input[id="all"]:checked').each(function() {
					chk_value.push($(this).val());
				});
				return chk_value.join(",");
			}
		});
	</script>
</body>
</html>